package com.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
  int code;
  String message;
  T data;

  public static Result<String> serverError(String mesg) {
    return new Result<>(500, "server error", mesg);
  }

  public static Result<String> success() {
    return new Result<>(1, "success", null);
  }
}
